#include "gamewindow.h"
#include "ui_gamewindow.h"
#include "QMessageBox"
#include "QEvent"
#include "QDebug"
#include "QPushButton"

gamewindow::gamewindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::gamewindow)
{
    ui->setupUi(this);

    musicplayer=new QMediaPlayer;
    musicplayer->setMedia(QUrl("qrc:/opera.mp3"));
    musicplayer->setVolume(70);  
    //bgm
}

gamewindow::~gamewindow()
{
    delete ui;
}


void gamewindow::on_pushButton_2_clicked()
{
    musicplayer->play();
}//开始

void gamewindow::on_pushButton_clicked()
{
   musicplayer->stop();
}//暂停
